#ifndef QLOGMANAGER_H
#define QLOGMANAGER_H

#include "core_global.h"

#include <QObject>
#include <QDateTime>

#define MAX_LOG_COUNT   1000

struct tagLogInfo
{
    QDateTime   m_time;
    QString     m_text;
    QString     m_tag;
};

class CORELIB_EXPORT QLogManager : public QObject
{
    Q_OBJECT
public:
    explicit QLogManager(QObject *parent = 0);
    
    void    add_log(const QString &tag,const QString &text);
    void    clear();

    QList<tagLogInfo> logs();

    void    set_max_count(int count);
signals:
    void    refresh();
public slots:
protected:
    QList<tagLogInfo>      m_logs;
    int             m_max_log_count;
};

#endif // QLOGMANAGER_H
